<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="org.dualr.litelog.entity.Photo"%>
<%@ page import="org.dualr.litelog.dao.PhotoDao"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon" />
<link href="simplestyle.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="view.css" rel="stylesheet" type="text/css" media="screen"/>
<style type="text/css">
#banner {margin-left:10%; position:relative; width:335px; height:261px; border:1px solid #666; overflow:hidden;}
#banner_list img {border:0px;}
#banner_bg {position:absolute; bottom:0;background-color:#000;height:30px;filter: Alpha(Opacity=30);opacity:0.3;z-index:1000;cursor:pointer; width:478px; }
#banner_info{position:absolute; bottom:0; left:5px;height:22px;color:#fff;z-index:1001;cursor:pointer}
#banner_text {position:absolute;width:120px;z-index:1002; right:3px; bottom:3px;}
#banner ul {position:absolute;list-style-type:none;filter: Alpha(Opacity=80);opacity:0.8; border:1px solid #fff;z-index:1002;
            margin:0; padding:0; bottom:3px; right:5px;}
#banner ul li { padding:0px 8px;float:left;display:block;color:#FFF;border:#e5eaff 1px solid;background-color:#6f4f67;cursor:pointer}
#banner_list a{position:absolute;} <!-- 让四张图片都可以重叠在一起-->
</style>
</head>
<body>
<div id="wrapper">
	<%@include file="index_header.jsp" %>
	<div id="main">
		<div id="content">
			<div class="post">
				<div class="entry">

					<p>宋玮 | 深圳 | www.paipai.com</p>

				</div>
			</div>
			
	<div id="banner">    
	    <div id="banner_bg"></div>  <!--标题背景-->
	    <div id="banner_info"></div> <!--标题-->
	    <ul>
	        <li>1</li>
	        <li>2</li>
	        <li>3</li>
	        <li>4</li>
	    </ul>
	   
	    <div id="banner_list">
		<%
		List<Object[]> photoList = PhotoDao.getInstance().getAllByCategory(
				0, 6,67004); //拉取轮播分类用的图片
				if(photoList.size() != 0){
					for(Object[] photo : photoList){
		%>

	        <a href="photo?id=<%=photo[0].toString()%>" target="_blank"><img height="251px" width="335px" src="http://weisong-note.appspot.com/photo?id=<%=photo[0].toString()%>"  title="<%=photo[3].toString()%>" alt="<%=photo[3].toString()%>" /></a>
		<%
			}
				}
		%>
	    </div>
	</div>

			
		</div>
		<div id="main-right">
			<div class="right-column">
					<h2>订阅RSS</h2>
						<ul>
							<a href="http://9.douban.com/reader/subscribe?url=http://weisong-note.appspot.com/rss" target="_blank" title="ä¹ç¹"><img src="images/icon_rss_douban.gif" alt="ä¹ç¹"  border="0" vspace="2"></img></a>	
					    	<a href="http://www.zhuaxia.com/add_channel.php?url=http://weisong-note.appspot.com/rss" target="_blank" title="æè¾"><img src="images/icon_rss_zhuaxia.gif" alt="æè¾" border="0" vspace="2"></img></a>
						    <a href="http://www.xianguo.com/subscribe.php?url=http://weisong-note.appspot.com/rss" target="_blank" title="é²æ"><img src="images/icon_rss_xianguo.gif" alt="é²æ" border="0" vspace="2"></img></a>
					    	<a href="http://fusion.google.com/add?feedurl=http://weisong-note.appspot.com/rss" target="_blank" title="google reader"><img src="images/icon_rss_google.gif" alt="google reader" border="0" vspace="2"></img></a>
					    	<a href="http://inezha.com/add?url=http://weisong-note.appspot.com/rss" target="_blank" title="åªå"><img src="images/icon_rss_nazha.gif" alt="åªå" border="0" vspace="2"></img></a>
					    	<a href="http://mail.qq.com/cgi-bin/feed?u=http://weisong-note.appspot.com/rss" target="_blank" title="QQé®ç®±"><img src="images/icon_rss_qq.gif" alt="QQé®ç®±"  border="0" vspace="2"></img></a>
					    	<a href="http://reader.youdao.com/b.do?keyfrom=feedsky&amp;url=http://weisong-note.appspot.com/rss" target="_blank"><img src="images/icon_rss_youdao.gif" alt="æé" title="æé" border="0" vspace="2"></img></a>
						</ul>	
				</div>

		</div>
		<div class="clear"></div>
		<%@include file="index_footer.jsp" %>
</div>
<script type="text/javaScript" src="js/common.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
    var t = n = 0, count;
    $(document).ready(function(){    
        count=$("#banner_list a").length;  
        $("#banner_list a:not(:first-child)").hide();
        $("#banner_info").html($("#banner_list a:first-child").find("img").attr('alt'));
        $("#banner_info").click(function(){window.open($("#banner_list a:first-child").attr('href'), "_blank")});
        $("#banner li").click(function() {
            var i = $(this).text() - 1;//获取Li元素内的值，即1，2，3，4
            n = i;
            if (i >= count) return;
            $("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt'));
            $("#banner_info").unbind().click(function(){window.open($("#banner_list a").eq(i).attr('href'), "_blank")})
            $("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
            $(this).css({"background":"#be2424",'color':'#000'}).siblings().css({"background":"#6f4f67",'color':'#fff'});
        });
        t = setInterval("showAuto()", 4000);
        $("#banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);});
    })
    
    function showAuto()
    {
        n = n >=(count - 1) ? 0 : ++n;
        $("#banner li").eq(n).trigger('click');
    }
</script>
</body>
</html>
